package com.fanben100.gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.SystemColor;

import javax.swing.JLabel;
import javax.swing.JPanel;

import com.fanben100.util.DateUtil;

/**
 * 状态栏
 * 
 * @author Administrator
 * 
 */
class StatusBar extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public StatusBar() {
		setLayout(new BorderLayout());
		setPreferredSize(new Dimension(10, 23));

//		JPanel leftPanel = new JPanel();
//		leftPanel.add(new JLabel("联网状态:联网", JLabel.LEFT));
//		leftPanel.add(new JLabel("系统时间:" + DateUtil.getCurrentDate(),
//				JLabel.LEFT));

		JPanel rightPanel = new JPanel(new BorderLayout());
		rightPanel.add(new JLabel(new AngledLinesWindowsCornerIcon()),
				BorderLayout.SOUTH);
//		rightPanel.add(new JLabel("联网状态:联网", JLabel.LEFT), BorderLayout.WEST);
//		rightPanel.add(new JLabel("系统时间:" + DateUtil.getCurrentDate(),
//				JLabel.LEFT), BorderLayout.CENTER);

		rightPanel.setOpaque(false);

		add(rightPanel, BorderLayout.EAST);
		// add(leftPanel, BorderLayout.WEST);
		setBackground(SystemColor.control);
	}

	protected void paintComponent(Graphics g) {
		super.paintComponent(g);

		int y = 0;
		g.setColor(new Color(156, 154, 140));
		g.drawLine(0, y, getWidth(), y);
		y++;
		g.setColor(new Color(196, 194, 183));
		g.drawLine(0, y, getWidth(), y);
		y++;
		g.setColor(new Color(218, 215, 201));
		g.drawLine(0, y, getWidth(), y);
		y++;
		g.setColor(new Color(233, 231, 217));
		g.drawLine(0, y, getWidth(), y);

		y = getHeight() - 3;
		g.setColor(new Color(233, 232, 218));
		g.drawLine(0, y, getWidth(), y);
		y++;
		g.setColor(new Color(233, 231, 216));
		g.drawLine(0, y, getWidth(), y);
		y = getHeight() - 1;
		g.setColor(new Color(221, 221, 220));
		g.drawLine(0, y, getWidth(), y);

	}

}